<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 200px;
            height: 100%;
            margin: 0 auto;
            /* border: 1px solid #000; */
        }
        p{
            width: 200px;
            height: 30px;
            background-color: aqua;
            line-height: 30px;
        }
        ul{
            width: 200px;
            height: 100%;
            margin-left: -40px;
            margin-top: -20px;
            display: none;
        }
        li{
            list-style: none;
            width: 100%;
            height: 20px;
            background-color: bisque;
           
            border: 1px solid #fff;
            
        }
    </style>
</head>
<body>
    <div>
        <p>播放列表 <span>^</span></p>
        <ul>
            <li>1</li>
            <li>2</li>
            <li>3</li>
        </ul>
    </div>
</body>
</html>
<script>
    var p = document.querySelector('p')
    var ul = document.querySelector('ul')
    p.onclick = function () {
        if(ul.style.display != 'none'){
            ul.style.display = 'none'
        }else{
            ul.style.display = 'block'
        }
    }
</script>